﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms.Design;
using System.Windows.Forms;


namespace SZ
{
    //创建一个关于浏览和获取文件夹路径的类
    public class FolderDialogClass : FolderNameEditor
    {
        FolderNameEditor.FolderBrowser folderDialog = new FolderBrowser();
        public FolderDialogClass()
        {
        }

        public DialogResult DisplayDialog()
        {
            return DisplayDialog("请选择一个文件夹！");
        }

        public DialogResult DisplayDialog(string description)
        {
            folderDialog.Description = description;
            return folderDialog.ShowDialog();
        }

        public string Path
        {
            get
            {
                return folderDialog.DirectoryPath;
            }
        }

        ~FolderDialogClass()
        {
            folderDialog.Dispose();
        }
    }
}
